<?php
class Room extends RoomPeer
{
	function Room()
	{
		parent::RoomPeer();
	}
	
	
	function getAllPictures()
	{
		$picture_ids = $this->getpictures();
		$picture_ids = json_decode($picture_ids, true);
		$pictures = array();
		if ($picture_ids)
			foreach ($picture_ids as $id) 
				if ($id) {
					$pic = new Picture();
					$pic->select($id);
					$pictures[] = $pic;
				}

		return $pictures;	
	}
	
	function getRealPrice()
	{
		$price = $this->getprice();
		$promotion = $this->getpromotion();
		if ($promotion != 0)
			$price = $price * (100-$promotion) / 100;
		return $price;
	}
}
?>